Modification of the round() workaround for MSVC, defining in defs.h instead of lowran...
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 Jul 2013 01:30:52 +0000 (01:30 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 Jul 2013 01:30:52 +0000 (01:30 +0000)
gpsbabel/defs.h
gpsbabel/lowranceusr.cc
gpsbabel/lowranceusr4.cc

index c426f5a3e413625d8df9979703d590079e92d1fc..17361a9f819403421b30b1bf7d5a43dbb501a4f6 100644 (file)
@@ -1037,6 +1037,13 @@ char* rot13(const QString& str);
 
 signed int si_round(double d);
 
+#if _MSC_VER
+//These functions are not included in the MS pre C99 implementation, use internal implementation
+//This asssumes that non-_MSC_VER includes math.h (all should include defs.h)
+#define round si_round
+#define lround si_round
+#endif
+
 /*
  * Data types for Palm/OS files.
  */
index 3171a255b6e09f8a4035c97c44773e45cb9fa280..0c1685b5d65608fec97ff30ab03fa42b9fd9f083 100644 (file)
 #include <string.h>
 #include <math.h> /* for lat/lon conversion */
 
-#if defined(_MSC_VER)
-//Incomplete implementation, use existing GB function
-#define lround si_round 
-#endif
-
 typedef struct lowranceusr_icon_mapping {
   const int    value;
   const char*  icon;
index 6f26cca106701bb4d916535e09ffb71f1df78b8d..db8ccfaa37e27f0b39f283c7a0530e609bb5a7a4 100644 (file)
 #include <math.h> /* for lat/lon conversion */
 #include <time.h> /* for gmtime */
 
-#if defined(_MSC_VER)
-//Incomplete implementation, use existing GB function
-#define round si_round
-#endif
-
 /* from waypt.c, we need to iterate over waypoints when extracting
    routes */
 extern queue waypt_head;